<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            background-size: cover;
        }

        ul {
            display: flex;
            /* justify-content: center; */
            width: 1200px;
            margin: 100px auto 0 auto;
            border: 3px solid #333;
        }

        ul li {
            width: 300px;
            height: 180px;
            list-style: none;
            opacity: 0.7;
        }

        ul li img {
            width: 100%;
            height: 100%;
        }
    </style>
</head>

<body>
    <ul>
        <li><img src="/pink/imgs/03.png" alt="" title="1"></li>
        <li><img src="/pink/imgs/04.png" alt="" title="2"></li>
        <li><img src="/pink/imgs/zyz_txt/1.png" alt="" title="3"></li>
        <li><img src="/pink/imgs/zyz_txt/2.png" alt="" title="4"></li>
    </ul>
    <script>
        var ul = document.querySelector('ul')
        var  img= document.querySelectorAll('ul img')
        // console.log(img);
        var bd = document.body
        // console.log(lis);
        for (let i = 0; i < img.length; i++) {
            
            img[i].addEventListener('click', function (e) {
                console.log();
          bd.style.backgroundImage="url("+this.src+")"
        // console.log(this);
            })
        }
    </script>
</body>

</html>